﻿<%@ WebHandler Language="C#" Class="CollectionDeleteAll" %>

using System;
using System.Web;
using Newtonsoft.Json;
using OTS.Common;
using OTS.Model;
using OTS.BLL;

public class CollectionDeleteAll : IHttpHandler,System.Web.SessionState.IReadOnlySessionState 
{
    
    public void ProcessRequest (HttpContext context) {
        PageSuccess page = new PageSuccess();

        if (context.Session["custom"]==null)
        {
            page.success = false;
            page.msg = "非法操作！";
        }
        else
        {
            custom cus = (custom)context.Session["custom"];
            FavoriteBLL favBLL = new FavoriteBLL();
            favBLL.DeleteAll(cus.cusID);
            page.success = true;
            page.msg = "删除成功！";
        }
        
        context.Response.ContentType = "application/x-json";
        context.Response.Charset = "utf-8";
        context.Response.Write(JavaScriptConvert.SerializeObject(page));
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}